package model.components.nodes.node;

public class PhysicalSwitch extends PhysicalNode
{
	public static final String NAME_PREFIX = "PhysicalSwitch";
	
	public PhysicalSwitch( String networkName, int number, String operatingSystem, String virtualEnvironment, int cpu, int memory, int availableVirtualNodesNumber )
	{
		super( networkName, PhysicalSwitch.NAME_PREFIX, number, Node.SWITCH_TYPE, operatingSystem, virtualEnvironment, cpu, memory, availableVirtualNodesNumber, Node.GREY_SWITCH, Node.GREEN_SWITCH, Node.YELLOW_SWITCH, Node.RED_SWITCH );
	}
	
	@Override
	public PhysicalSwitch getCopy()
	{
		PhysicalSwitch physicalSwitch = new PhysicalSwitch( this.getNetworkName(), this.getNumber(), this.getOperatingSystem(), this.getVirtualEnvironment(), this.getCpu(), this.getMemory(), this.getAvailableVirtualNodesNumber() );
		physicalSwitch.setInitialNumber( this.getInitialNumber() );
		physicalSwitch.setNamePrefix( this.getNamePrefix() );
		physicalSwitch.setType( this.getType() );
		physicalSwitch.setAvailableCpu( this.getAvailableCpu() );
		physicalSwitch.setAvailableMemory( this.getAvailableMemory() );
		physicalSwitch.setMaxVirtualNodesNumber( this.getMaxVirtualNodesNumber() );
		physicalSwitch.setTimeStamp( this.getTimeStamp() );
		physicalSwitch.setSelected( this.isSelected() );
		
		for( VirtualNode virtualNode: this.getVirtualNodes() )
			physicalSwitch.add( virtualNode.getCopy() );
		
		return physicalSwitch;
	}

}
